package td.pt;

import td.domain.Thought;
import td.pt.widget.cell.ThoughtListing;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.CellList;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.gwtplatform.mvp.client.ViewImpl;

public class ThinkerView extends ViewImpl implements ThinkerPresenter.MyView {

	private final Widget widget;

	public interface Binder extends UiBinder<Widget, ThinkerView> {
	}

	/**
	 * The main List.
	 */
	@UiField(provided = true)
	CellList<Thought> latestThoughts;

	@Inject
	public ThinkerView(final Binder binder, ThoughtListing thoughtListing) {
		latestThoughts = new CellList<Thought>(thoughtListing);
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}

	@Override
	public CellList<Thought> getLatestThoughts() {
		return latestThoughts;
	}
}
